﻿using Lis.DALFactory;
using Lis.IDAL;
using Lis.IRepository;
using Lis.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lis.Repository
{
    public class BookDetailRepository:GenericRepository<BookDetail>,IBookDetailRepository
    {
        #region 01，根据docnumber查询图书详情+IEnumerable<BookDetail> GetEntitiesByDocNumber(string docNumber)
        /// <summary>
        /// 根据docnumber查询图书详情
        /// </summary>
        /// <param name="docNumber">docnumber</param>
        /// <returns></returns>
        public IEnumerable<BookDetail> GetEntitiesByDocNumber(string docNumber)
        {
            return ((IBookDetailDal)CurrentDal).GetEntitiesByDocNumber(docNumber);
        } 
        #endregion

        public override void GetDal()
        {
            CurrentDal = AbstractDalFactory.GetBookDetailDal();
        }

        #region 02，根据BarCode查询图书详情+IEnumerable<BookDetail> GetEntitiesByBarCode(string barCode)
        /// <summary>
        /// 根据BarCode查询图书详情
        /// </summary>
        /// <param name="barCode">馆藏号</param>
        /// <returns></returns>
        public IEnumerable<BookDetail> GetEntitiesByBarCode(string barCode)
        {
            return ((IBookDetailDal)CurrentDal).GetEntitiesByBarCode(barCode);
        } 
        #endregion
    }
}
